package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WaterMonthlyUsageMapper;
import com.ruoyi.system.domain.WaterMonthlyUsage;
import com.ruoyi.system.service.IWaterMonthlyUsageService;

/**
 * 月用水量汇总Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-20
 */
@Service
public class WaterMonthlyUsageServiceImpl implements IWaterMonthlyUsageService
{
    @Autowired
    private WaterMonthlyUsageMapper waterMonthlyUsageMapper;

    /**
     * 查询月用水量汇总
     *
     * @param id 月用水量汇总主键
     * @return 月用水量汇总
     */
    @Override
    public WaterMonthlyUsage selectWaterMonthlyUsageById(Long id)
    {
        return waterMonthlyUsageMapper.selectWaterMonthlyUsageById(id);
    }

    /**
     * 查询月用水量汇总列表
     *
     * @param waterMonthlyUsage 月用水量汇总
     * @return 月用水量汇总
     */
    @Override
    public List<WaterMonthlyUsage> selectWaterMonthlyUsageList(WaterMonthlyUsage waterMonthlyUsage)
    {
        return waterMonthlyUsageMapper.selectWaterMonthlyUsageList(waterMonthlyUsage);
    }

    /**
     * 新增月用水量汇总
     *
     * @param waterMonthlyUsage 月用水量汇总
     * @return 结果
     */
    @Override
    public int insertWaterMonthlyUsage(WaterMonthlyUsage waterMonthlyUsage)
    {
        waterMonthlyUsage.setYear("2025");
        waterMonthlyUsage.setCreateTime(DateUtils.getNowDate());
        return waterMonthlyUsageMapper.insertWaterMonthlyUsage(waterMonthlyUsage);
    }

    /**
     * 修改月用水量汇总
     *
     * @param waterMonthlyUsage 月用水量汇总
     * @return 结果
     */
    @Override
    public int updateWaterMonthlyUsage(WaterMonthlyUsage waterMonthlyUsage)
    {
        return waterMonthlyUsageMapper.updateWaterMonthlyUsage(waterMonthlyUsage);
    }

    /**
     * 批量删除月用水量汇总
     *
     * @param ids 需要删除的月用水量汇总主键
     * @return 结果
     */
    @Override
    public int deleteWaterMonthlyUsageByIds(Long[] ids)
    {
        return waterMonthlyUsageMapper.deleteWaterMonthlyUsageByIds(ids);
    }

    /**
     * 删除月用水量汇总信息
     *
     * @param id 月用水量汇总主键
     * @return 结果
     */
    @Override
    public int deleteWaterMonthlyUsageById(Long id)
    {
        return waterMonthlyUsageMapper.deleteWaterMonthlyUsageById(id);
    }
}
